const { getDefaultConfig } = require('@expo/metro-config');

const defaultConfig = getDefaultConfig(__dirname);

defaultConfig.transformer.babelTransformerPath = require.resolve('react-native-svg-transformer');
defaultConfig.resolver.assetExts = defaultConfig.resolver.assetExts.filter(ext => ext !== 'svg');
defaultConfig.resolver.sourceExts = [...defaultConfig.resolver.sourceExts, 'svg'];

// 添加 .cube 文件支持
defaultConfig.resolver.assetExts = [...defaultConfig.resolver.assetExts, 'cube'];

// 配置 Reanimated 禁用严格模式警告
defaultConfig.transformer.minifierConfig = {
  ...defaultConfig.transformer.minifierConfig,
  mangle: {
    ...defaultConfig.transformer.minifierConfig?.mangle,
    keep_fnames: true,
  },
};

module.exports = defaultConfig; 